<?php 
	session_start();
	if (isset($_SESSION['username']) && isset($_SESSION['uid'])) {
		require('../../Controller/MaintainSystem_controller.php');
		$admin = new MaintainSystem();
		$account = $_SESSION['username'];
		$uid = $_SESSION['uid'];
		if($admin->checkUser($account, $uid)) {
			$user_data = $admin->showAllUser();
	
		}else {
			header("location:../../login.php");
		}	
	}else {
		header("location:../../login.php");
	}
?>
<html>

<head>
	<meta http-equiv="Content-Type" content="width=device-width; text-html; charset=utf-8" />
	<script type="text/javascript" src="../../CSS/bootstrap/js/jquery.js"></script>
    <script type="text/javascript" src="../../CSS/bootstrap/js/bootstrap.min.js"></script>	
	<link href="../../CSS/bootstrap/css/bootstrap.css" rel="stylesheet" />
	    <link rel="stylesheet" href="../CSS/bootstrap/css/font-awesome.css">	    
	<title>FaceTech</title>	        
	<style>
      body {
        padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
      }
    </style>
    <link href="../../CSS/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
	<style type="text/css">
      body {
        padding-top: 60px;
        padding-bottom: 40px;
      }
      .sidebar-nav {
        padding: 9px 0;
      }
      .media, .media-body {
    		overflow:hidden;
    		*overflow:visible;
    		zoom:1;
    	}
    	.media {
    		margin-bottom: 10px;
    	}
    	.media .media {
    		margin-top: 20px;
    	}
    	.media .pull-left {
    		margin-right: 10px;
    	}
    	.media .pull-right {
    		margin-left: 10px;
    	}
    	.media .media-object {
    		display: block;
    	}
    	/* Media list */
    	.medias {
    		margin-top: 20px;
    		margin-left: 0;
    		list-style-type: none;
    	}
    	.medias .media {
    		padding-bottom: 10px;
    		border-bottom: 1px solid rgba(0,0,0,.07);
    	}
    	.medias > .media:last-child {
    		margin: 0;
    		border-bottom: none;
    	}
    	.medias > .media .media {
    		margin-bottom: 0;
    		padding-bottom: 0;
    		border-bottom: none;
    	} 
    	/* Media box */
    	.media-box {
    		margin-bottom: 10px;
    		padding: 10px;
    		background-color: #fff;
    		border: 1px solid rgba(0,0,0,.09);
    		-webkit-border-radius: 4px;
    		-moz-border-radius: 4px;
    		border-radius: 4px;
    		-webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    		-moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    		box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    	}
    	@media (max-width: 480px) {
    	    .media .pull-left,
    	    .media .pull-right  {
    	    	float: none;
    	    	display: block;
    	    	margin-bottom: 10px;
    	    }
    	    .media .pull-left {
    	        margin-right: 0;    
    	    }
    	    .media .pull-right {
    	        margin-left: 0;    
    	    }
    	}
    </style>
    <link href="../../CSS/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
	<link href="../../CSS/bootstrap/css/bbootstrap.min.css" rel="stylesheet" media="screen">
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->    
    <script language="javascript">
		function show(did){
			var xx=document.getElementById(did).style.display;
			if(xx==""){
				document.getElementById(did).style.display="none";
			}else{
				document.getElementById(did).style.display="";
			}
		}
	</script>
</head>

<body>	
	<div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="ManagerPage.php">FaceTech</a>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li class="active"><a href="./ManagerPage.php"><i class="icon-home icon-white"></i>Home</a></li>
              <li class="active"><a href="../logout.php"><i class="icon-off icon-white"></i>Logout</a></li>          		
            </ul>           
            <p class="navbar-text pull-right">
              Logged in as <a href="ManagerPage.php" class="navbar-link">
				<?php echo $account;?>
				</a>
            </p>            
          </div><!--/.nav-collapse -->
        </div> 
      </div>
    </div>
    
	<div class="container">
		<div class="container-fluid">
			<div class="row-fluid">
				<div class="span3">
				<div class="well sidebar-nav">
					<ul class="nav nav-list">
				 	<li class="nav-header"><h5 align="center">Management</h5></li>
  					<li class="divider"></li>
  					<li><a class="btn btn-link" onClick="javascript:ChangePage('UserInfo');">UserAccount</a></li>
  					<li><a class="btn btn-link" onClick="javascript:ChangePage('Message');">Message</a></li>
					</ul>
				</div>
				</div>
				<div class="span9">
					<iframe name="content" id="loadpage" src="UserInfo.php" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>
				</div>
			</div>
		</div>	
	</div>
	
<script>
	function ChangePage(page)
	{
		element=document.getElementById('loadpage');
		switch(page)
		{
			case 'UserInfo':
				element.src="UserInfo.php";
				break;
			case 'Message':
				element.src="Message.php";
				break;
		}
	}
</script>
	
	
	
</body>

</html>

